/** @import { Token } from './types' */

/** @type {() => Token} */
function readToken() {
    return JSON.parse(window.localStorage.getItem("token"));
}

/** @type {(token: Token) => void} */
function writeToken(token) {
    window.localStorage.setItem("token", JSON.stringify(token));
}

export { readToken, writeToken };